home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-17 / cfg10.zip / CFG.DOC < prev    next >
Text File  |  1993-02-01  |  25KB  |  639 lines

  1.  
  2.                              CFG.SYS Version 1.0
  3.  
  4.                                Mark Treadwell
  5.                              1247 Foursome Lane
  6.                      Virginia Beach, Virginia 23455-6819
  7.                             Voice: (804) 497-3281
  8.                             CompuServe 73700,3344
  9.  
  10.  
  11.                       Copyright (c) 1992 Mark Treadwell
  12.                              All Rights Reserved
  13.  
  14.  
  15.  
  16. CFG.SYS is a system device driver that provides multiple utilities for use
  17. during CONFIG.SYS execution.  The program does not remain resident and
  18. releases all memory on termination.  Suggestions for additions to the
  19. CFG.SYS collection are welcome.  Contact me via CompuServe Mail or in the
  20. CompuServe Forum section corresponding to the library CFG.SYS was downloaded
  21. from.
  22.  
  23.  
  24. ───────────────────────────────────────────────────────────────────────────
  25.                                    TO USE
  26. ───────────────────────────────────────────────────────────────────────────
  27.  
  28.  
  29. Syntax      DEVICE=[drive:][path]CFG.SYS CommandName [Options]
  30.  
  31.  
  32. Parameter   [drive:][path]
  33.                   Specifies the location of the CFG.SYS file.
  34.  
  35.             CommandName
  36.                   The list of valid CommandNames is given in the COMMANDS
  37.                   section below.  The CommandNames must be spelled exactly
  38.                   as shown.
  39.  
  40.             [Options]
  41.                   CommandName related options are detailed below.
  42.  
  43.  
  44. Switches    None.
  45.  
  46.  
  47. Example     DEVICE=C:\DOS\START\CFG.SYS AltPause
  48.  
  49.  
  50. Help        For help from the DOS command line, "TYPE CFG.SYS" will display
  51.             an abbreviated command summary.
  52.  
  53.  
  54. Notes       Case does not matter in CONFIG.SYS.  DOS capitalizes everything
  55.             in the file during its preliminary scan.  This is pertinent when
  56.             using the Echo or EchoPause commands.
  57.  
  58.  
  59.                      PC Magazine PATCH Utility Variables
  60.                      ───────────────────────────────────
  61.       [TEXT]      : Carriage Return/Line Feed Insert Character
  62.                   : Lower Case Toggle Character
  63.  
  64.       [NUMBER]    : Tone Low Point Frequency
  65.                   : Tone High Point Frequency
  66.                   : Tone Step Value
  67.                   : Tone Duration
  68.  
  69.  
  70. ───────────────────────────────────────────────────────────────────────────
  71.                                   COMMANDS
  72. ───────────────────────────────────────────────────────────────────────────
  73.  
  74. All command line formats and examples given below should be understood to
  75. begin with "DEVICE=[drive:][path]CFG.SYS " in the CONFIG.SYS file.
  76.  
  77. ══════════════════
  78.  
  79. Beep        Beeps the speaker.
  80.  
  81.             Command line format:
  82.  
  83.                   Beep
  84.  
  85.             Writes an ASCII 7 to the screen to trigger the BIOS beep sound
  86.             routine.
  87.  
  88. ══════════════════
  89.  
  90. Cls         Clears the screen with a choice of foreground and background
  91.             colors.
  92.  
  93.             Command line format:
  94.  
  95.                   Cls foreground [on] background
  96.  
  97.             The following colors may be used:
  98.  
  99.                   - Black           - Grey
  100.                   - Blue            - Bright Blue
  101.                   - Green           - Bright Green
  102.                   - Cyan            - Bright Cyan
  103.                   - Red             - Bright Red
  104.                   - Magenta         - Bright Magenta
  105.                   - Yellow          - Bright Yellow
  106.                   - White           - Bright White
  107.  
  108.             If any color in the right column is chosen for a background, the
  109.             video display is reprogrammed to show intense background colors
  110.             vice blinking text.  Some programs may subsequently reset this. 
  111.             Intense background colors are not available if ANSI.SYS is
  112.             installed.
  113.  
  114.             If ANSI.SYS is not installed, these colors are not permanent and
  115.             the DOS standard grey on black may begin to scroll depending on
  116.             the behavior of the video adapter.  If ANSI.SYS is installed
  117.             before CFG.SYS is run, CFG.SYS will detect it and use ANSI
  118.             escape sequences to change system colors.
  119.  
  120.             Note that the "Bright ..." colors are scanned on the command
  121.             line with only a single space between the words.  This was done
  122.             to simplify the logic of the routine.  Otherwise, CFG.SYS will
  123.             accept any number of spaces between words.
  124.  
  125.             If no colors a given or if an invalid combination is used, the
  126.             current screen colors are used.  No error message is generated
  127.             for improper format or spelling.
  128.  
  129.             This function is loosely based on two programs:  the CLS.SYS
  130.             driver written by William R. Peate [76525,2366] and uploaded to
  131.             the CompuServe ZiffNet ZNT:TIPS Forum Library 16 (Gen Utils) on
  132.             10 April 1992 and PC Magazine's BATCHMAN.COM written by Charles
  133.             Petzold.  The command line color scanning and ANSI code was
  134.             written by the author.
  135.  
  136. ══════════════════
  137.  
  138. ComHide     Hides and restores the serial port base addresses.
  139.  
  140.             Command line format:
  141.  
  142.                   ComHide H|R
  143.  
  144.             The "H" option hides the serial port base addresses.  The "R"
  145.             option restores them.  One of the two must be used.  Error
  146.             messages are displayed if the routine fails.
  147.  
  148.             ComHide hides the serial port base addresses by copying them to
  149.             another location in memory when the "H" option is used.  On
  150.             restoration with the "R" option, ComHide verifies the signature
  151.             and checksum stored with the port address to ensure that they
  152.             were not accidently over written while hidden.  ComHide then
  153.             copies the base addresses back to their normal location.
  154.  
  155.             The default location for the hidden data is 7001:0000.  This is
  156.             below the 512 Kb boundary in the event that the machine only has
  157.             that much base memory available, and high enough to keep it from
  158.             being over-written during execution of other device drivers
  159.             while the data is hidden.
  160.  
  161.             Example command lines:
  162.  
  163.                   CFG.SYS ComHide H
  164.                   COM.SYS
  165.                   CFG.SYS ComHide R
  166.  
  167.             This function was adapted from the LptHide function.
  168.  
  169. ══════════════════
  170.  
  171. ComSwap     Swaps the serial base port addresses for the two serial ports
  172.             specified.
  173.  
  174.             Command line format:
  175.  
  176.                   ComSwap a b
  177.  
  178.             where a and b are the numbers of the serial ports to be swapped. 
  179.             Valid numbers are 1, 2, 3 and 4.  An error message will be given
  180.             if one of the ports is missing or invalid.
  181.  
  182.             ComSwap switches the two ports as far as DOS is concerned.  This
  183.             is useful if you need to shift the ports around prior to loading
  184.             software device drivers.
  185.  
  186.             Example command line:
  187.  
  188.                   CFG.SYS ComSwap 4 2
  189.  
  190.             This function was written by the author.
  191.  
  192. ══════════════════
  193.  
  194. Echo        Sends a comment line to the screen.
  195.  
  196.             Command line format:
  197.  
  198.                   Echo [String to be displayed]
  199.  
  200.             Since DOS capitalizes everything on the CONFIG.SYS command line,
  201.             a carat "^" is used as the default character to toggle between
  202.             upper and lower case for the displayed string.  If a carat is
  203.             desired on the displayed line, two ("^^") should be used on the
  204.             input line.  Used without text, Echo outputs a carriage
  205.             return/line feed sequence.
  206.  
  207.             A tilde "~" is the default character for insertion of a carriage
  208.             return/line feed sequence in the displayed line.
  209.  
  210.             Example command line:
  211.  
  212.                   CFG.SYS Echo S^tart ^DEVICE ^section...~
  213.  
  214.             This command line would display "Start DEVICE section..." with
  215.             two trailing carriage return/line feeds.
  216.  
  217.             This function was adapted and expanded from COMMENT.SYS written
  218.             by Skip Gilbrech [71445,534] on 05/19/85.
  219.  
  220. ══════════════════
  221.  
  222. EchoPause   Suspends execution after printing a prompt message on the screen
  223.             that is specified on the command line.
  224.  
  225.             Command line format:
  226.  
  227.                   EchoPause [String to be displayed]
  228.  
  229.             Pressing any key resumes execution.  Command line text should be
  230.             formatted as in the Echo command.  Use KeyPause for optional
  231.             pausing.
  232.  
  233.             This function was adapted by the author from the Echo and Pause
  234.             commands.
  235.  
  236. ══════════════════
  237.  
  238. EGA25       Sets a 25 line color EGA screen.
  239.  
  240.             Command line format:
  241.  
  242.                   EGA25
  243.  
  244.             Performs a mode 3 reset of the display adapter.  This works on
  245.             EGA in a display independent way.
  246.  
  247.             This function was written by the author.
  248.  
  249. ══════════════════
  250.  
  251. EGA43       Sets a 43 line EGA screen.
  252.  
  253.             Command line format:
  254.  
  255.                   EGA43
  256.  
  257.             Forces the use of the display adapter's internal 8x8 font. 
  258.             Interrupt 10H Function 11H Subfunction 12H performs an adapter
  259.             mode reset when it executes.  This works on EGA in a display
  260.             independent way.
  261.  
  262.             This function was written by the author.
  263.  
  264. ══════════════════
  265.  
  266. KeyPause    Suspends execution if the Shift, Alt or Ctrl keys are pressed.
  267.  
  268.             Command line format:
  269.  
  270.                   KeyPause
  271.  
  272.             One of the listed keys must be held down before program
  273.             execution.  Execution resumes once the key is released.  Use
  274.             Pause for prompted pausing.
  275.  
  276.             This function was adapted from a debug script in message #143888
  277.             in the CompuServe ZiffNet ZNT:TIPS Forum Section 4
  278.             (User-to-User) from Neil Rubenking [72241,50] to Oscar (no last
  279.             name) [75040,33] on 8 July 1992.  Neil uploaded it as
  280.             ALTPAUSE.SYS, even though it worked for all shift keys.  Neil
  281.             has had the driver for a while and was not sure where or when he
  282.             originally got it.
  283.  
  284. ══════════════════
  285.  
  286. LptHide     Hides and restores the printer port base addresses.
  287.  
  288.             Command line format:
  289.  
  290.                   LptHide H|R
  291.  
  292.             The "H" option hides the printer port base addresses.  The "R"
  293.             option restores them.  One of the two must be used.  Error
  294.             messages are displayed if the routine fails.
  295.  
  296.             The specific driver this was written for is the Iomega Bernoulli
  297.             Box RCD.SYS driver.  During RCD.SYS initialization, it
  298.             interrogates the printer ports to determine if there are any
  299.             parallel port Bernoulli Boxes installed.  Unfortunately, some
  300.             printers respond to this interrogation by printing the
  301.             interrogation sequence.
  302.  
  303.             LptHide hides the printer port base addresses by copying them to
  304.             another location in memory when the "H" command is used.  On
  305.             restoration with the "R" command, LptHide verifies the signature
  306.             and checksum stored with the port address to ensure that they
  307.             were not accidently over written during RCD.SYS execution. 
  308.             LptHide then copies the base addresses back to their normal
  309.             location.
  310.  
  311.             The default location for the hidden data is 7000:0000.  This is
  312.             below the 512 Kb boundary in the event that the machine only has
  313.             that much base memory available, and high enough to keep it from
  314.             being over-written during execution of other device drivers
  315.             while the data is hidden.
  316.  
  317.             Example command lines:
  318.  
  319.                   CFG.SYS LptHide H
  320.                   RCD.SYS /M0
  321.                   CFG.SYS LptHide Restore
  322.  
  323.             This function was adapted and expanded from the device driver
  324.             LPTHIDE.SYS uploaded as LPTHID.SYS to CompuServe CIS:PCVENE
  325.             Library 3 (Iomega Corp.) on 13 March 1992 by Ronald Routh
  326.             [75300,2511].
  327.  
  328. ══════════════════
  329.  
  330. LptSwap     Swaps the printer base port addresses for the two printer ports
  331.             specified.
  332.  
  333.             Command line format:
  334.  
  335.                   LptSwap a b
  336.  
  337.             where a and b are the numbers of the printer ports to be
  338.             swapped.  Valid numbers are 1, 2 and 3.  An error message will
  339.             be given if one of the ports is missing or invalid.
  340.  
  341.             LptSwap switches the two ports as far as DOS is concerned.  This
  342.             is useful if you need to shift the printer ports around and are
  343.             loading a software print buffer as a device driver.
  344.  
  345.             Example command line:
  346.  
  347.                   CFG.SYS LptSwap 1 3
  348.  
  349.             This function was written by the author.
  350.  
  351. ══════════════════
  352.  
  353. Mono        Sets a 25 line monochrome screen.
  354.  
  355.             Command line format:
  356.  
  357.                   Mono
  358.  
  359.             Performs a mode 7 reset of the display adapter.  This works in a
  360.             display independent way.  Use this function only if a monochrome
  361.             monitor is installed.
  362.  
  363.                   This function was written by the author.
  364.  
  365. ══════════════════
  366.  
  367. Pause       Suspends execution after printing a prompt message on the
  368.             screen.
  369.  
  370.             Command line format:
  371.  
  372.                   Pause
  373.  
  374.             Pressing any key resumes execution.  Use KeyPause for optional
  375.             pausing.  The standard prompt is "CFG.SYS Pause - Press any key
  376.             to continue . . .".
  377.  
  378.             This function was adapted from a Debug script for PAUSE.SYS
  379.             written by Jeff Prosise and published in the Tutor section of
  380.             the 30 June 1992 issue of PC Magazine.
  381.  
  382. ══════════════════
  383.  
  384. Tones       Programs the system's speaker port to emit a rising (Upward) or
  385.             falling (Downward) series of tones.
  386.  
  387.             Command line format:
  388.  
  389.                   Tones U|D
  390.  
  391.             A missing or incorrect command line argument will abort the
  392.             program with an error message.
  393.  
  394.             This function is based on the sound routines contained in the
  395.             ALLKEYS.COM program by Robert L. Morton as published in the 28
  396.             June 1988 issue of PC Magazine.
  397.  
  398. ══════════════════
  399.  
  400. VGA25       Sets a 25 line color VGA screen.
  401.  
  402.             Command line format:
  403.  
  404.                   VGA25
  405.  
  406.             Performs a mode 3 reset of the display adapter.  This works on
  407.             VGA in a display independent way.
  408.  
  409.             This function was written by the author.
  410.  
  411. ══════════════════
  412.  
  413. VGA43       Sets a 43 line VGA screen.
  414.  
  415.             Command line format:
  416.  
  417.                   VGA43
  418.  
  419.             Forces the use of the display adapter's internal 8x14 font. 
  420.             Interrupt 10H Function 11H Subfunction 11H performs an adapter
  421.             mode reset when it executes.  This works on VGA in a display
  422.             independent way.
  423.  
  424.             This function was written by the author.
  425.  
  426. ══════════════════
  427.  
  428. VGA50       Sets a 50 line VGA screen.
  429.  
  430.             Command line format:
  431.  
  432.                   VGA50
  433.  
  434.             Forces the use of the display adapter's internal 8x8 font. 
  435.             Interrupt 10H Function 11H Subfunction 12H performs an adapter
  436.             mode reset when it executes.  This works on VGA in a display
  437.             independent way.
  438.  
  439.             This function was written by the author.
  440.  
  441. ══════════════════
  442.  
  443. WaitFor     Delays program execution for the number of minutes and seconds
  444.             given on the command line.
  445.  
  446.             Command line format:
  447.  
  448.                   WaitFor [m:]s
  449.  
  450.             Where m is the delay time in minutes and s is in seconds.  If a
  451.             single number is on the command line, it is assumed to be
  452.             seconds.  The default is one second.
  453.  
  454.             Pressing any key during the wait period will immediately cancel
  455.             the wait.
  456.  
  457.             This function is adapted from PC Magazine's BATCHMAN.COM written
  458.             by Charles Petzold.
  459.  
  460.  
  461. ───────────────────────────────────────────────────────────────────────────
  462.                           DISCLAIMER - RESTRICTIONS
  463. ───────────────────────────────────────────────────────────────────────────
  464.  
  465.  
  466. CFG.SYS is freeware, or what is known as "zero-cost shareware".  CFG.SYS is
  467. not what is generally called "public domain" software because the author
  468. retains the copyright.  However, the CFG.SYS package can be copied, used and
  469. distributed freely as long as CFG.SYS, its documentation file (CFG.DOC), and
  470. associated ZIF file are not altered and are distributed together, preferably
  471. in the original unchanged ZIP file.
  472.  
  473. CFG.SYS can be included in shareware packages as long as both CFG.SYS and
  474. its related files are included in the shareware package.  If you have
  475. received CFG.SYS as part of some larger shareware package, please be aware
  476. that you may freely use, copy and distribute CFG.SYS without paying a fee
  477. for, or registering, the larger package.
  478.  
  479. CFG.SYS is supplied as is.  The author disclaims all warranties, expressed
  480. or implied, including, without limitation, the warranties of merchantability
  481. and of fitness for any purpose.  The author assumes no liability for
  482. damages, direct or consequential, which may result from the use of CFG.SYS.
  483.  
  484. CFG.SYS should work for all DOS versions from 2.0 upward.  It has been
  485. specifically tested only on DOS 5.0.  I would appreciate confirmation of
  486. satisfactory operation on older versions of DOS.
  487.  
  488. If you find CFG.SYS useful, I would like to know.  I would appreciate a
  489. short note via US Mail or CompuServe Mail telling me what you like or
  490. dislike about CFG.SYS.  If you need other functions or output, please
  491. contact me.
  492.  
  493. I will upload the most recent version of CFG.SYS to various forums on
  494. CompuServe and ZiffNet under the file name "CFG.ZIP".  If the file does not
  495. appear with my PPN, it may not be the most recent upload.
  496.  
  497.  
  498. ───────────────────────────────────────────────────────────────────────────
  499.                               ACKNOWLEDGEMENTS
  500. ───────────────────────────────────────────────────────────────────────────
  501.  
  502.  
  503. My thanks and recognition goes to the authors listed above for their
  504. original versions of the utilities presented here.  A special tip of the hat
  505. goes to Rod Pullman [CompuServe 76226,3120] for his very useful DEVICE.COM
  506. utility.  DEVICE loads DOS character device drivers subsequent to system
  507. boot.  It also works great to test nonresident character device drivers like
  508. CFG.  Without it, testing and debugging CFG.SYS would have been too hard to
  509. contemplate.
  510.  
  511.  
  512. ───────────────────────────────────────────────────────────────────────────
  513.                                ERROR MESSAGES
  514. ───────────────────────────────────────────────────────────────────────────
  515.  
  516.       CFG.SYS           ERROR - Invalid command
  517.                         ───
  518.                         Issued if specified CommandName is incorrect or
  519.                         missing.
  520.  
  521.       CFG.SYS ComHide   ERROR - No option found.  'H' or 'R' is required.
  522.                         ───
  523.                         Issued if CommandName Option does not begin with the
  524.                         correct letter.  CFG.SYS only checks the first
  525.                         character after the CommandName, the rest of the
  526.                         line is ignored.
  527.  
  528.       CFG.SYS ComHide   ERROR - Hidden ports already present.
  529.                         ───
  530.                         Issued if Hide is run twice in succession without a
  531.                         Restore in between.  A second Hide action would
  532.                         permanently erase the base port addresses.
  533.  
  534.       CFG.SYS ComHide   ERROR - Could not locate hidden ports.
  535.                         ───
  536.                         Issued if the signature is missing from the upper
  537.                         memory hidden storage location.  This could be due
  538.                         to the area having been over-written or due to a
  539.                         Restore being run without a preliminary Hide
  540.                         operation.
  541.  
  542.       CFG.SYS ComHide   ERROR - Checksum invalid, ports not restored.
  543.                         ───
  544.                         The checksum stored with the hidden ports shows that
  545.                         the data has been changed since it was written,
  546.                         probably due to being over-written.
  547.  
  548.       CFG.SYS ComSwap   ERROR - Missing or invalid port.
  549.                         ───
  550.                         Issued if only one port is given on the command line
  551.                         or if the port requested is other than 1, 2, 3 or 4.
  552.  
  553.       CFG.SYS ComSwap   ERROR - Cannot swap the same port.
  554.                         ───
  555.                         Issued if the ports requested are the same.
  556.  
  557.       CFG.SYS LptHide   ERROR - No option found.  'H' or 'R' is required.
  558.                         ───
  559.                         See ComHide description.
  560.  
  561.       CFG.SYS LptHide   ERROR - Hidden ports already present.
  562.                         ───
  563.                         See ComHide description.
  564.  
  565.       CFG.SYS LptHide   ERROR - Could not locate hidden ports.
  566.                         ───
  567.                         See ComHide description.
  568.  
  569.       CFG.SYS LptHide   ERROR - Checksum invalid, ports not restored.
  570.                         ───
  571.                         See ComHide description.
  572.  
  573.       CFG.SYS LptSwap   ERROR - Missing or invalid port.
  574.                         ───
  575.                         See ComSwap description.
  576.  
  577.       CFG.SYS LptSwap   ERROR - Cannot swap the same port.
  578.                         ───
  579.                         See ComSwap description.
  580.  
  581.       CFG.SYS Sound     ERROR - Missing or incorrect command option.
  582.                         ───
  583.                         Issued if CommandName Option is missing or does not
  584.                         begin with the correct letter.  CFG.SYS only checks
  585.                         the first character after the CommandName, the rest
  586.                         of the line is ignored.
  587.  
  588.       CFG.SYS WaitFor   ERROR - Missing or incorrect delay value.
  589.                         ───
  590.                         Issued if CommandName Option is missing or does not
  591.                         begin with a number.  CFG.SYS only checks for a ':'
  592.                         between the minutes and seconds.  Any other
  593.                         character will cause the minutes value to be treated
  594.                         as seconds and the seconds value to be ignored.
  595.  
  596.  
  597. ────────────────────────────────────────────────────────────────────────────
  598.                               REVISION HISTORY
  599. ────────────────────────────────────────────────────────────────────────────
  600.  
  601.  
  602. Version 1.0  ---  28 August 1992
  603.       First version.  Supports Beep, Cls, ComHide, ComSwap, Echo, EchoPause,
  604.       EGA43, KeyPause, LptHide, LptSwap, Pause, Tones, VGA43, VGA50 and
  605.       WaitFor commands.
  606.  
  607.  
  608. ────────────────────────────────────────────────────────────────────────────
  609.                                  DISCUSSION
  610. ────────────────────────────────────────────────────────────────────────────
  611.  
  612.  
  613.    Many utilities exist for use from the command line.  When I added
  614. Qualitas' BlueMax 6.0 to my system, what was once a relatively short boot
  615. display became quite a protracted affair.  I wanted to neaten and add color
  616. to the device driver installation phase as well as add messages and optional
  617. pauses.  I foresaw my disk becoming overrun by numerous small device
  618. drivers, so I wrote the basic CFG.SYS shell handler and then started looking
  619. around for useful utilities.
  620.  
  621.    CFG.SYS is executed during the device driver installation phase of system
  622. boot.  It does not remain resident in memory and may be run multiple times
  623. in CONFIG.SYS.
  624.  
  625.    CFG.SYS sets up its own 512 byte stack to avoid overflowing the DOS stack
  626. during operation.  The program then moves the command line from the system
  627. buffer to a local buffer for parsing.  The CommandName is scanned and the
  628. appropriate function is executed.  The function is responsible for any
  629. additional command line parsing.
  630.  
  631.    Upon completion of the function, the command handler regains control and
  632. performs the final clean-up processing required by DOS for termination of
  633. the driver.  The DOS stack in use at program entry is restored and CFG.SYS
  634. ends with a Far Return to DOS.
  635.  
  636.    General parsing allows any of the standard DOS delimiter characters to be
  637. ignored.  With the exception of the bright Cls colors noted above, the
  638. number of spaces between command line words does not matter.
  639.